package com.hr.outTime.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hr.outTime.mapper.OutTimeMapper;
import com.hr.outTime.domain.OutTime;
import com.hr.outTime.service.IOutTimeService;

/**
 * 设置保护期超时Service业务层处理
 * 
 * @author guan
 * @date 2024-08-01
 */
@Service
public class OutTimeServiceImpl implements IOutTimeService 
{
    @Autowired
    private OutTimeMapper outTimeMapper;

    /**
     * 查询设置保护期超时
     * 
     * @param userLevel 设置保护期超时主键
     * @return 设置保护期超时
     */
    @Override
    public OutTime selectOutTimeByUserLevel(Integer userLevel)
    {
        return outTimeMapper.selectOutTimeByUserLevel(userLevel);
    }

    /**
     * 查询设置保护期超时列表
     * 
     * @param outTime 设置保护期超时
     * @return 设置保护期超时
     */
    @Override
    public List<OutTime> selectOutTimeList(OutTime outTime)
    {
        return outTimeMapper.selectOutTimeList(outTime);
    }

    /**
     * 新增设置保护期超时
     * 
     * @param outTime 设置保护期超时
     * @return 结果
     */
    @Override
    public int insertOutTime(OutTime outTime)
    {
        return outTimeMapper.insertOutTime(outTime);
    }

    /**
     * 修改设置保护期超时
     * 
     * @param outTime 设置保护期超时
     * @return 结果
     */
    @Override
    public int updateOutTime(List<OutTime> outTime)
    {
        for (OutTime o : outTime){
            outTimeMapper.updateOutTime(o);
        }
        return 1;
    }

    /**
     * 批量删除设置保护期超时
     * 
     * @param userLevels 需要删除的设置保护期超时主键
     * @return 结果
     */
    @Override
    public int deleteOutTimeByUserLevels(Integer[] userLevels)
    {
        return outTimeMapper.deleteOutTimeByUserLevels(userLevels);
    }

    /**
     * 删除设置保护期超时信息
     * 
     * @param userLevel 设置保护期超时主键
     * @return 结果
     */
    @Override
    public int deleteOutTimeByUserLevel(Integer userLevel)
    {
        return outTimeMapper.deleteOutTimeByUserLevel(userLevel);
    }
}
